#!/usr/bin/env node

const http = require('http');
const log = console.log;
// let url = 'http://wangding:123@www.baidu.com:8080/a/b/c?age=20&gender=M#/d/e/f';
// url = new URL(url);
// log(url);

http.createServer((req,res)=>{
    let url = new URL(req.url, `http://${req.headers.host}`);
    log(url.pathname);
    log(url.searchParams);
}).listen(8080);                 